﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MPMovieCatalog.Forms
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();
        }

        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (treeView1.SelectedNode != null && treeView1.SelectedNode.Tag != null)
            {
                Type type = Type.GetType(treeView1.SelectedNode.Tag.ToString());
                if (type != null)
                {
                    UserControl userControl = (UserControl)System.Activator.CreateInstance(type);
                    panel.Controls.Add(userControl);
                }
            }
        }
    }
}
